package cn.ygh.bbo.framerwork.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ygh
 * @Desc mybatis 默认配置
 * @date 2019/11/26
 */
@Configuration
public class MybatisAutoConfiguration {

    /**
     * 分页插件
     * @return
     */
    @Bean
    public PageHelper pageHelper(){
        return new PageHelper();
    }

    /**
     * 乐观锁插件
     * @return
     */
    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor(){
        return new OptimisticLockerInterceptor();
    }
}
